echo "stop服务开始"
pidlist=`ps -ef|grep love-app.jar | grep -v "grep"|awk '{print $2}'`
#ps -u $USER|grep "Java"|grep -v "grep"
if [ "$pidlist" = "" ]; then
        echo "no love-app pid alive"
else
        echo "love-app Id list :$pidlist"
        for pid in ${pidlist}
        {
                kill -9 $pid
                echo "KILL $pid:"
                echo "service stop success"
        }
fi
echo "stop服务脚本结束"

sleep 1
nohup java -jar love-app.jar   >nohup.out 2>&1 &
#sleep 1
        pid=$(ps aux | grep love-app.jar | grep -v grep |awk '{print $2}')
        if [ -n "$pid" ]; then
                # 如果pid不为空的话，证明启动成功
                echo "启动成功,进程号:$pid"
        else
                echo "启动失败,请手动启动"
        fi
tail -f nohup.out


